#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
using namespace std;

map<string,int> telephoneBook;
map<char,char> letter2digit;

string ProcessPhone(string& str)
{
	string res = "";
	int count = 0;
	for (int i = 0;i<str.size();i++)
	{
		if (str[i] >= 'A' && str[i] <= 'Z' && str[i] != 'Q' && str[i] != 'Z')
		{

			count ++;
			res = res + letter2digit[str[i]];
		}else if (str[i] >= '0' && str[i] <= '9')
		{

			count ++;
			res = res + str[i];
		}else{
			continue;
		}

		if (count == 3)
		{
			res = res + "-";
		}
	}
	return res;
}
int main1002()
{
	letter2digit['A'] = '2';letter2digit['B'] = '2';letter2digit['C'] = '2';
	letter2digit['D'] = '3';letter2digit['E'] = '3';letter2digit['F'] = '3';
	letter2digit['G'] = '4';letter2digit['H'] = '4';letter2digit['I'] = '4';
	letter2digit['J'] = '5';letter2digit['K'] = '5';letter2digit['L'] = '5';
	letter2digit['M'] = '6';letter2digit['N'] = '6';letter2digit['O'] = '6';
	letter2digit['P'] = '7';letter2digit['R'] = '7';letter2digit['S'] = '7';
	letter2digit['T'] = '8';letter2digit['U'] = '8';letter2digit['V'] = '8';
	letter2digit['W'] = '9';letter2digit['X'] = '9';letter2digit['Y'] = '9';

	int N;
	string str;
	cin >> N;
	for (int i = 0;i<N;i++)
	{
		cin >> str;
		string standStr = ProcessPhone(str);
		if (telephoneBook.find(standStr) == telephoneBook.end())
		{
			telephoneBook[standStr] = 1;
		}else{
			telephoneBook[standStr] ++;
		}
	}

	map<string,int>::iterator it;
	bool bHasDuplicates = false;
	for (it = telephoneBook.begin();it!=telephoneBook.end();it++)
	{
		if ((*it).second > 1)
		{
			bHasDuplicates = true;
			cout << (*it).first << " " << (*it).second << endl;
		}
	}
	if (!bHasDuplicates)
	{
		cout << "No duplicates." << endl;
	}
	return 0;
}